﻿/*
 * PsTFS is a set of PowerShell commands to manage and use Team Foundation Server. PowerShell 
 * effectiveness is combined with the power of TFS API to maximizes TFS capabilities.
 * 
 * Creator : Choulant Noham
 * Mail : choulant@gmail.com
 * Blog : http://choulant.blogspot.com
 * 
 */

using System.Management.Automation;
using PsTFS.Objects;


namespace PsTFS.Commandes.Get
{
    /// <summary>
    /// Permet l'éxcution du log
    /// </summary>
    [Cmdlet(VerbsCommon.Get, "PsTFSLog")]
    public class GetLogTFS: PsCmdlet
    {
        /// <summary>
        /// Lancement du processus
        /// </summary>
        protected override void ProcessRecord()
        {
            if (Clear.ToBool())
            {
                Log.ClearLog();
            }
            else
            {
                WriteObject(Log.GetLog());
            }
        }

        /// <summary>
        /// Log de l'application
        /// </summary>
        [Parameter(Position = 0)]
        [ValidateNotNullOrEmpty]
        public SwitchParameter Clear { get; set; }
    }

}